import { FormSchema } from '/@/components/Table';
import { userStore } from '/@/store/modules/user';
export const areaSearch = (schemas: FormSchema[], index: number, colProps) => {
  const obj: FormSchema = {
    label: '区域：',
    field: 'city',
    component: 'AreaCascader',
    colProps,
  };
  if (userStore.getUserInfoState.admin) {
    const record = schemas.some((item) => {
      return item.field == obj.field;
    });
    if (!record) {
      schemas.splice(index, 0, obj);
    }
  }
  return schemas;
};
